Relocatable Object Module Format
   HOME

TheInfoList



OR:

The Relocatable Object Module Format (OMF) is an
object file An object file is a computer file containing object code, that is, machine code output of an assembler or compiler. The object code is usually relocatable, and not usually directly executable. There are various formats for object files, and the ...
format used primarily for software intended to run on
Intel 80x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
microprocessor A microprocessor is a computer processor where the data processing logic and control is included on a single integrated circuit, or a small number of integrated circuits. The microprocessor contains the arithmetic, logic, and control circ ...
s. Version 4.0 was released by Intel in 1981 under the name ''Object Module Format'', and is perhaps best known to
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
users as an ''.OBJ file''. It has since been standardized by the Tool Interface Standards Committee.


File format

Many object file formats consist of a set of tables, such as the relocation table, which are either stored on fixed positions in the file, like the a.out format, or are pointed to by the header, like the
ELF An elf () is a type of humanoid supernatural being in Germanic mythology and folklore. Elves appear especially in North Germanic mythology. They are subsequently mentioned in Snorri Sturluson's Icelandic Prose Edda. He distinguishes "ligh ...
format. The "sections", code, data area, etc., are stored as contiguous areas of bytes within such files. The Relocatable Object Module Format, however, was designed to require minimal memory when linking, and consists of a series of records that have the following format: There is a wide variety of record types because of consolidation of OMF variants from several vendors, and because of adding such features as 32-bit code and dynamic linking. These are important record types: * COMENT - (88h) Comment, which may also contain control information. * EXTDEF - (8Ch) Defines external references * PUBDEF - (90h/91h) Identifies external symbols in this module * SEGDEF - (98h/99h) Identifies segments * GRPDEF - (9Ah) Identifies groups of segments, for example MS-DOS DGROUP * FIXUPP - (9Ch/9Dh) ''Fixup'' or relocation records * LEDATA - (A0h/A1h) Contains text of a code or data section * COMDEF - (B0h) Uninitialized common data * COMDAT - (C2h/C3h) Initialized common data * MODEND - (8Ah/8Bh) Indicates end of module There is no header containing file offsets, such as a pointer to a symbol table, in the file; a
linker Linker or linkers may refer to: Computing * Linker (computing), a computer program that takes one or more object files generated by a compiler or generated by an assembler and links them with libraries, generating an executable program or shar ...
must completely parse the object file to extract all the information. In the OMF format the data of one section is not necessarily stored as contiguous bytes in the file, instead it ''can'' be represented by multiple records. The file format specification (version 1.1) says that this ''must'' be done for sections larger than 1 KiB. Records containing relocation information (fixups) must be stored immediately following the data records of the section they apply to, so the section data and the relocation information is "mixed" in the file. The file format provides special records (LIDATA) that allow compression of repeating data sequences in an object file. It also provides the possibility to store the symbol name of the entry point of the later executable file in one object file. The file format can also be used as
library A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
file format.


Use

The file format is the most important object file format under DOS, 16-bit
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ser ...
, and 16-bit and 32-bit
OS/2 OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 r ...
. Few toolchains use the 32-bit version of the OMF format. For example, the Watcom C toolchain allows generating code for targets that use 32-bit segmented memory layouts; Iron Spring
PL/I PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative computer programming language developed and published by IBM. It is designed for scientific, engineering, business and system programming. I ...
can generate code for OS/2 32-bit flat memory layouts. The
Embarcadero Delphi Delphi is a general-purpose programming language and a software product that uses the Delphi dialect of the Object Pascal programming language and provides an integrated development environment (IDE) for rapid application development of desktop, ...
compiler used this format when generating obj files for C++. It was the only format of object files that could be linked to a program or unit written in Object Pascal prior to version XE2 of Delphi, which introduced support of
COFF The Common Object File Format (COFF) is a format for executable, object code, and shared library computer files used on Unix systems. It was introduced in Unix System V, replaced the previously used a.out format, and formed the basis for ex ...
format, along with 64-bit Windows target.


See also

*
Common Object File Format The Common Object File Format (COFF) is a format for executable, object code, and shared library computer files used on Unix systems. It was introduced in Unix System V, replaced the previously used a.out format, and formed the basis for exten ...
(COFF) *
Executable and Linkable Format In computing, the Executable and Linkable FormatTool Interface Standard (TIS) Portable Formats SpecificationVersion 1.1'' (October 1993) (ELF, formerly named Extensible Linking Format), is a common standard file format for executable files, ...
(ELF) * a.out


References


Further reading

* Code

ftp://ftp.iecc.com/pub/linker/] Errata

{{Executables Executable file formats Computer file formats